package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PartyFormalMapper;
import com.ruoyi.system.domain.PartyFormal;
import com.ruoyi.system.service.IPartyFormalService;

/**
 * 正式党员转正Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-16
 */
@Service
public class PartyFormalServiceImpl implements IPartyFormalService 
{
    @Autowired
    private PartyFormalMapper partyFormalMapper;

    /**
     * 查询正式党员转正
     * 
     * @param formalId 正式党员转正主键
     * @return 正式党员转正
     */
    @Override
    public PartyFormal selectPartyFormalByFormalId(Long formalId)
    {
        return partyFormalMapper.selectPartyFormalByFormalId(formalId);
    }

    /**
     * 查询正式党员转正列表
     * 
     * @param partyFormal 正式党员转正
     * @return 正式党员转正
     */
    @Override
    public List<PartyFormal> selectPartyFormalList(PartyFormal partyFormal)
    {
        return partyFormalMapper.selectPartyFormalList(partyFormal);
    }

    /**
     * 新增正式党员转正
     * 
     * @param partyFormal 正式党员转正
     * @return 结果
     */
    @Override
    public int insertPartyFormal(PartyFormal partyFormal)
    {
        partyFormal.setCreateTime(DateUtils.getNowDate());
        return partyFormalMapper.insertPartyFormal(partyFormal);
    }

    /**
     * 修改正式党员转正
     * 
     * @param partyFormal 正式党员转正
     * @return 结果
     */
    @Override
    public int updatePartyFormal(PartyFormal partyFormal)
    {
        partyFormal.setUpdateTime(DateUtils.getNowDate());
        return partyFormalMapper.updatePartyFormal(partyFormal);
    }

    /**
     * 批量删除正式党员转正
     * 
     * @param formalIds 需要删除的正式党员转正主键
     * @return 结果
     */
    @Override
    public int deletePartyFormalByFormalIds(Long[] formalIds)
    {
        return partyFormalMapper.deletePartyFormalByFormalIds(formalIds);
    }

    /**
     * 删除正式党员转正信息
     * 
     * @param formalId 正式党员转正主键
     * @return 结果
     */
    @Override
    public int deletePartyFormalByFormalId(Long formalId)
    {
        return partyFormalMapper.deletePartyFormalByFormalId(formalId);
    }
}
